import java.util.Date;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-20
 * Time: 13:57
 */
class Animal{
    public String name;
    public Animal(String name) {
        this.name = name;
    }
    public void eat(String food) {
        System.out.println(this.name + "正在吃" + food);
    }
}

class Cat extends Animal{
    public Cat(String name) {
        //super调用父类的构造方法
        //子类需要先帮父类构造方法
        super(name);
    }
}

class Bird extends Animal{
    public Bird(String name) {
        super(name);
    }
    public void fly() {
        System.out.println(this.name + "会飞. 起飞🛫");
    }
}

public class Test01 {
    public static void main(String[] args) {
        Cat cat = new Cat("小猫咪");
        cat.eat("🐟");
        Bird bird = new Bird("八哥");
        bird.eat("果子");
    }
}
